function eulerIntegrate(pdb, simulationLength) {

    //alert("in euler");

    // simulationLength is the total number of steps in the simulation
    var thisAtom;
    var otherAtom;
    var forces = new Array();
    var velocities = new Array();
    var timestep = 3;
    var mass = 0.2;

    // fill the forces and velocities arraya with 0-vectors
    for (var i = 0; i < pdb.data.atoms.length; i++)
    {
        forces[i] = new PhiloGL.Vec3();
        velocities[i] = new PhiloGL.Vec3();
    }
    // console.log("X0i = "+pdb.data.atoms[1].data.x)

    // perform Euler integration for simulationLength
    for (var step = 0; step < simulationLength; step++) 
    {
        // reset the forces to zero
        for (var i = 0; i < pdb.data.atoms.length; i++)
        {
            forces[i] = new PhiloGL.Vec3(0,0,0);
        }
        // then, calculate the new forces
        for (var i = 0; i < pdb.data.atoms.length; i++) // loop over every atom
        {
            thisAtom = pdb.data.atoms[i];
            thisAtomPos = new PhiloGL.Vec3(parseFloat(thisAtom.data.x),parseFloat(thisAtom.data.y),parseFloat(thisAtom.data.z));
            for (var j = i + 1; j < pdb.data.atoms.length; j++) // loop over all subsequent atoms
            {
                otherAtom = pdb.data.atoms[j];
                otherAtomPos = new PhiloGL.Vec3(parseFloat(otherAtom.data.x),parseFloat(otherAtom.data.y),parseFloat(otherAtom.data.z));


                // get the vector pointing from otherAtom to thisAtom
                var distanceVector = thisAtomPos.sub(otherAtomPos);

                // calculate an attractive inverse-squares force imparted to thisAtom by otherAtom
                var ijForce = distanceVector.unit().scale(0.1 *(-Math.pow(1/distanceVector.norm(),13) + (Math.pow(1/distanceVector.norm(),7)) ));
                var jiForce = ijForce.scale(-1); // Newton's 3rd!

                // add these forces to thisAtom and otherAtom
                forces[i].$add(ijForce);
                forces[j].$add(jiForce);
                // console.log(forces[i]);
            }
            // then, update thisAtom's velocity
            velocities[i].$add(forces[i].scale(0.5 * timestep / mass));

            // print debug info to console
        }
        // console.log("F0 = "+forces[0]);
        // console.log("V0 = "+velocities[0]);
        // finally, update the positions
        for (var i = 0; i < pdb.data.atoms.length; i++) // loop over every atom
        {
            // NOTE: This alters the original pdb object!
            thisAtom = pdb.data.atoms[i];
            thisAtomPos = new PhiloGL.Vec3(parseFloat(thisAtom.data.x),parseFloat(thisAtom.data.y),parseFloat(thisAtom.data.z));
        
            newPos = thisAtomPos.add(velocities[i].scale(timestep));

            // console.log("newPos: "+newPos);

            // assign the new position
            // NOTE: I'm honestly not sure whether a = b creates an alias of b or an independent copy. Need to play around in a javascript console.
            pdb.data.atoms[i].data.x = String(newPos.x);
            pdb.data.atoms[i].data.y = String(newPos.y);
            pdb.data.atoms[i].data.z = String(newPos.z);            
        }
        // console.log("X0f = "+pdb.data.atoms[0].data.x)
        updateAtoms(pdb);

    }
    //alert("end of euler");
    
}

